<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 求斐波那契数列40个数，这个数列的特点为:第1,2两个数为1和1，从第三个数开始，该数是前面两个数的和，即1.1.2.3,5,8,13,21...
        var a = 1, b = 1, c = 0;
        for(var i = 3; i <= 40; i++){
            c = a + b;
            console.log(c);
            a = b;
            b = c;
            }
         

    </script>
    
</body>
</html>